package fr.contacts.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import fr.contacts.constant.Constant;
import fr.contacts.models.Adresse;
import fr.contacts.models.Contact;

@Controller
public class HomeController {
 
    @RequestMapping(value = "/")
    public String home(Model model) {
        System.out.println("HomeController: Passing through...");
        Constant.fillDateStringToIntMap();
        Constant.fillDateIntToStringMap();
        Contact c = new Contact();
        c.setActif(true);
        Adresse a = new Adresse();

        model.addAttribute("contact", c);
        model.addAttribute("adresse", a);
        model.addAttribute("user_action", "create");
        return "/WEB-INF/views/create.jsp";
    }
    

    
    
}	